# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=superlu
pkgver=5.2.1
pkgrel=0
pkgdesc="Sparse LU factorization library"
url="https://portal.nersc.gov/project/sparse/superlu/"
arch="all !mips !mips64" # blocked by openblas
license="BSD-3-Clause"
makedepends="
	cmake
	openblas-dev
	"
subpackages="
	$pkgname-dev
	"
source="
	https://portal.nersc.gov/project/sparse/superlu/superlu_$pkgver.tar.gz
	"
builddir=$srcdir/SuperLU_$pkgver

build() {
	mkdir build ; cd build
	cmake .. \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX:PATH=/usr \
		-DCMAKE_INSTALL_LIBDIR="lib" \
		-DCMAKE_INSTALL_INCLUDEDIR="include/superlu" \
		-Denable_blaslib=OFF \
		-DBUILD_SHARED_LIBS=ON
	make
}

check() {
	cd build
	ctest
}

package() {
	cd build
	make DESTDIR="$pkgdir" install
}

sha512sums="30538b4c2809294b8f34646bce6445944f21a1dffaf3ec0a0f29a55d5261caa56e4279d7722bb95cc9d89450d36ded969617edc82ecce7d0f1dfb24040d80d07  superlu_5.2.1.tar.gz"
